﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="task.aspx.cs" Inherits="WebApplication5.Pages.task" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContainerPlaceHolder" runat="server">
	<form id="form1" runat="server">
		<div class="panel-group" id="accordion">
			<div class="panel panel-default">
				<a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">
					<div class="panel-heading">
						<h4 class="panel-title">Opret Task
						</h4>
					</div>
				</a>
				<div id="collapseTwo" class="panel-collapse collapse">
					<div class="panel-body">

								<span class="form-label">Navn:</span>
                                <asp:TextBox ID="nameTb" CssClass="form-control" runat="server"> </asp:TextBox>
								
                                <span class="form-label">Type:</span>
				                <asp:TextBox ID="typeTb" CssClass="form-control" runat="server"> </asp:TextBox>


								<span class="form-label">Status:</span>
								<asp:TextBox ID="statusTb" CssClass="form-control" runat="server"> </asp:TextBox>

                                <asp:DropDownList ID="DropDownListAddUserstory" runat="server" CssClass="form-control"></asp:DropDownList>

                        <br />

                                

                        <asp:Button CssClass="btn btn-success btn-lg" ID="buttonCreate" OnClick="ButtonAdd_Click" Text="Opret" runat="server" />
					</div>
				</div>
			</div>
			<div class="panel panel-default">
				<a data-toggle="collapse" data-parent="#accordion" href="#collapseThree">
					<div class="panel-heading">
						<h4 class="panel-title">Ret Task
						</h4>
					</div>
				</a>
				<div id="collapseThree" class="panel-collapse collapse">
					<div class="panel-body">
						<asp:ScriptManager ID="ScriptManager2" runat="server" />
						<asp:UpdatePanel runat="server" ID="UpdatePanel2" UpdateMode="Conditional">
							<ContentTemplate>
								<Triggers>
									<asp:AsyncPostBackTrigger ControlID="UpdateButton1" EventName="Click" />
								</Triggers>
							
								<asp:DropDownList ID="DropDownListEdit" runat="server" CssClass="form-control"></asp:DropDownList>

								<asp:Button ID="UpdateButton1" CssClass="btn btn-warning" runat="server" Text="Hent Task" OnClick="ButtonGetTask_Click" /><br />

								<span class="form-label">Navn:</span>
								<asp:TextBox ID="nameTbe" runat="server" CssClass="form-control"></asp:TextBox>

								<span class="form-label">Type:</span>
								<asp:TextBox ID="typeTbe" runat="server" CssClass="form-control"></asp:TextBox>

								<span class="form-label">Status:</span>
								<asp:TextBox ID="statusTbe" runat="server" CssClass="form-control"></asp:TextBox>

                                <asp:DropDownList ID="DropDownListEditUserstories" runat="server" CssClass="form-control"></asp:DropDownList>


								<asp:Button CssClass="btn btn-success btn-lg" ID="ButtonEdit" runat="server" Text="Rediger" OnClick="ButtonEdit_Click" />
							
								</ContentTemplate>
							</asp:UpdatePanel>
					</div>
				</div>
			</div>
			<div class="panel panel-default">
				<a data-toggle="collapse" data-parent="#accordion" href="#collapseFour">
					<div class="panel-heading">
						<h4 class="panel-title">Slet Task
						</h4>
					</div>
				</a>
				<div id="collapseFour" class="panel-collapse collapse">
					<div class="panel-body">
<%--						<asp:UpdatePanel runat="server" id="updatepanel3" UpdateMode="Conditional">
							<ContentTemplate>
								<Triggers>
									<asp:AsyncPostBackTrigger ControlID="ButtonDeleteHouse" EventName="Click" />
								</Triggers>--%>
						<asp:DropDownList ID="DropDownListDelete" runat="server" CssClass="form-control"></asp:DropDownList>
						<asp:Button CssClass="btn btn-danger" ID="ButtonDeleteTask" runat="server" Text="Slet Task" OnClick="ButtonDelete_Click" />
<%--								</ContentTemplate>
							</asp:UpdatePanel>--%>
					</div>
				</div>
                			<div class="panel panel-default">
				<a data-toggle="collapse" data-parent="#accordion" href="#collapseFive">
					<div class="panel-heading">
						<h4 class="panel-title">Alle Task
						</h4>
					</div>
				</a>
				<div id="collapseFive" class="panel-collapse collapse">
					<div class="panel-body">

						<table class="table table-striped">
							<thead>
								<tr>
									<th>Id</th>
									<th>Navn</th>
                                    <th>Type</th>
                                    <th>Status</th>
								</tr>
							</thead>
							<tbody>
								<%
                                    List<WebApplication5.Model.Task> lou = tCtr.GetAllTasks();
									var TaskSource = from e in lou
													  select new
													  {
														  e.id,
														  e.name,
                                                          e.status,
                                                          e.type,
                                                          e.Userstory,
                                                          e.userstoryId,
                                                          
													  };
								%>
								<% foreach (var lo in TaskSource.ToList())
		   { %>
								<tr>
                                    <td><%=lo.id %></td>
									<td><%=lo.name %></td>
									<td><%=lo.type %></td>
                                    <td><%=lo.status %></td>

								</tr>
								<% } %>
							</tbody>
						</table>

					</div>
                    </div>
				</div>
			</div>
			</div>
        </form>

</asp:Content>
